package com.smarthome.common.tools.excel;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

/**
 * <p>
 * 表单样式
 * </p>
 */
public class SheetStyle {

    public static HSSFCellStyle getNormalHeaderStyle(HSSFWorkbook workBook) {
        HSSFCellStyle headerStyle = (HSSFCellStyle) workBook.createCellStyle();// 创建标题样式
        headerStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
        headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        HSSFFont headerFont = (HSSFFont) workBook.createFont();
        headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);// 字体加粗
        headerFont.setFontName("Times New Roman");
        headerFont.setFontHeightInPoints((short) 8);
        headerStyle.setFont(headerFont);
        headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); // 下边框
        headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);// 左边框
        headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);// 上边框
        headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);// 右边框
        return headerStyle;
    }

}
